package com.example.springbootmybatis.controller;

import com.example.springbootmybatis.service.impl.ServiceUser;
import com.example.springbootmybatis.vo.DengVo;
import com.example.springbootmybatis.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: springbootmybatis
 * @description:
 * @author: 诸葛龙辰
 * @create: 2022-11-24 01:08
 **/
@RestController
@RequestMapping("/login")
public class LoginCon {

    @Autowired
    private ServiceUser userService;

    @PostMapping("/loginUser")
    public Result login(@RequestBody DengVo loginVo){
        System.out.println(loginVo.toString());
        Result login = userService.login(loginVo.getName(),loginVo.getPassword());
        return login;
    }

}
